@echo off
::代码名称
set pname=chess
::测试用例数量
set testnum=30
::g++编译工具路径
set compiledir=C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\g++.exe

::编译代码
del %pname%.exe
echo generate exe........
"%compiledir%" -o %pname%.exe %pname%.cpp
IF ERRORLEVEL 1 goto exit

for /l %%i in (1, 1, %testnum%) do (
echo %pname%%%i.in
:: 拷贝测试输入文件
copy /y %pname%%%i.in %pname%.in
%pname%.exe
copy /y %pname%.out %pname%%%i.ans
del %pname%.in %pname%.out
)
del %pname%.exe

:exit
pause